package com.example.shop.user.service;

import com.example.shop.common.api.ServiceReturn;
import com.example.shop.pojo.User;
import com.example.shop.user.vo.BuyResult;
import com.example.shop.user.dto.GoodsBuyInfo;
import com.example.shop.user.websocket.InformWebSocketServer;

public interface BuyGoodsService {

    /**
     * 用户购买商品里的指定款式
     * @param user 购买的用户
     * @param buyInfo 购买的信息
     * @return 返回购买结果
     */
    ServiceReturn<BuyResult> buyGoods(User user, GoodsBuyInfo buyInfo,String webSocketSessionId);

    /**
     * 购买成功回调该接口
     * @param orderId 支付成功的订单的id
     */
    ServiceReturn<Boolean> buySuccess(Long orderId, InformWebSocketServer socketServer);
}
